class Path<NI, LI> {
  INode<NI, LI> startNode;
  INode<NI, LI> endNode;

  public Path (INode<NI, LI> startNode, INode<NI, LI> endNode) {
    this.startNode = startNode;
    this.endNode = endNode;
  }

  public boolean isValid() {
    return this.startNode.isConnectedTo(this.endNode);
  }
}
